<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>留言板 - 我的后台管理</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="__STATIC__/layui/css/layui.css" />
	<link rel="stylesheet" href="__CSS__/iconfont.css">
	<link rel="stylesheet" href="__CSS__/common.css">
</head>
<body class="childrenBody">

	<div class="main">
		<form class="layui-form" id="form_data">

			<div class="layui-form-item">
				<div class="layui-input-block" style="margin: 0px">
					<textarea name="content" style="width: 100%" rows="10">{$data.content|raw}</textarea>
				</div>		
			</div>

			<div class="layui-form-item">
				<div class="layui-input-block" style="margin: 0px">
					<input type="hidden" name="message_id" value="{$data.message_id}">
					<button type="button" class="layui-btn" lay-submit lay-filter="go">立即提交</button>
					<button type="reset"  class="layui-btn layui-btn-primary">重置</button>
			    </div>
			</div>
		</form>
	</div>
	
	<script type="text/javascript" src="__JS__/jquery.min.js"></script>
	<script type="text/javascript" src="__STATIC__/layui/layui.js"></script>

	<script type="text/javascript">
		
		layui.use(['form','layer'],function(){
			var form  = layui.form,
				layer = layui.layer,
				$ = layui.$;

		 	// 提交数据
			form.on('submit(go)', function(data){
		 		var index = top.layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.2});
		        // 序列化表单数据
				var form_data = $("#form_data").serialize();
				$.ajax({
					type: "POST",
			        url:"/admin/message/read_message",
					data:form_data,
					dataType:'json',
			        success: function(data){
		            	top.layer.close(index);
			        	if(data.status == -1){
			        		layer.alert(data.msg, {icon: 2});
			        	}else{
			        		layer.msg(data.msg, {icon: 1});
			        	}
			        }
				})
			})

		})

	</script>
</body>
</html>